<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/12 0012
 * Time: 11:10
 */

namespace app\admin\validate;


use think\Validate;

class Message extends Validate
{
    protected $rule = [
        'data'    =>'',
        'id'      => 'require',
        'title'   => 'require|max:100',
        'desc'    => 'require|max:100',
        'content' => 'require',
        'uid'     => 'require',
    ];

    protected $message = [
        'id.require'      =>  '请选择消息模板',
        'title.require'   =>  '请输入标题',
        'title.max'       =>  '标题过长',
        'desc.require'    =>  '请输入模板描述',
        'desc.max'        =>  '描述过长',
        'content.require' =>  '请输入模板内容',
        'uid.require'     =>  '请选择发送人',
    ];

    protected $scene = [
        'msglist'       =>  ['data'],
        'modeldetail'   =>  ['data'],
        'msgsend'       =>  ['uid','content','title'],
        'msgmodel'      =>  ['data'],
        'modelset'      =>  ['id','content','title','desc'],
        'modeldel'      =>  ['id'],
    ];
}